package com.mathmodeling.entity;

import javax.persistence.*;
import java.time.LocalDate;
import java.time.LocalDateTime;

@Entity
@Table(name = "contest")
public class Contest {
    
    @Id
    @Column(name = "id", length = 36)
    private String id;
    
    @Column(name = "title", length = 100, nullable = false)
    private String title;
    
    @Column(name = "start_time", nullable = false)
    private LocalDate startTime;
    
    @Column(name = "end_time", nullable = false)
    private LocalDate endTime;
    
    @Column(name = "result_release", nullable = false)
    private LocalDate resultRelease;
    
    @Column(name = "created_at")
    private LocalDateTime createdAt;
    
    // 构造函数
    public Contest() {}
    
    public Contest(String id, String title, LocalDate startTime, LocalDate endTime, LocalDate resultRelease) {
        this.id = id;
        this.title = title;
        this.startTime = startTime;
        this.endTime = endTime;
        this.resultRelease = resultRelease;
        this.createdAt = LocalDateTime.now();
    }
    
    // Getter和Setter方法
    public String getId() {
        return id;
    }
    
    public void setId(String id) {
        this.id = id;
    }
    
    public String getTitle() {
        return title;
    }
    
    public void setTitle(String title) {
        this.title = title;
    }
    
    public LocalDate getStartTime() {
        return startTime;
    }
    
    public void setStartTime(LocalDate startTime) {
        this.startTime = startTime;
    }
    
    public LocalDate getEndTime() {
        return endTime;
    }
    
    public void setEndTime(LocalDate endTime) {
        this.endTime = endTime;
    }
    
    public LocalDate getResultRelease() {
        return resultRelease;
    }
    
    public void setResultRelease(LocalDate resultRelease) {
        this.resultRelease = resultRelease;
    }
    
    public LocalDateTime getCreatedAt() {
        return createdAt;
    }
    
    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }
} 